#ifndef	__GUIINPUT_H_
#define	__GUIINPUT_H_

#include <cstdint>
#include <vector>
#include <gl\glfw.h>

#include "math.h"

class CInputListener
{
	public:
		virtual void OnMouseButton(const int32_t button, const int32_t action){};
		virtual void OnMouseClick(const int32_t startX, const int32_t startY, const int32_t endX, const int32_t endY){};
		virtual void OnMouseMove(const int32_t x, const int32_t y){};
		virtual void OnKeyEvent(const int32_t key, const int32_t action){};
		virtual void OnCharEvent(const int32_t key, const int32_t action){};
};

class CInputManager
{
	public:
		CInputManager();
		~CInputManager();

		void Update();

		static void GetMousePosition(int32_t& x, int32_t& y);
		static void GetLastMousePosition(int32_t& x, int32_t& y);
		static void GetMouseDownPos(int32_t& x, int32_t& y);
		static bool IsMouseButtonDown(const int32_t button);
		static void UpdateMouse();

	private:
		static std::vector<CInputListener*> m_vInputListeners;

		static vec2f m_v2f_MouseInitial;
		static vec2f m_v2f_MousePos;
		static vec2f m_v2f_LastMousePos;

		bool m_bMouseAlreadyDown;
};

#endif
